import { Controller, Get } from '@nestjs/common';
import { AlertsService } from './alerts.service';
import { Alert } from '../entities/alert.entity';
import { createResponse } from '../common/response.interface';
import type { IResponse } from '../common/response.interface';

@Controller('alerts')
export class AlertsController {
  constructor(private readonly alertsService: AlertsService) {}

  @Get()
  async findAll(): Promise<IResponse<Alert[]>> {
    const alerts = await this.alertsService.findAll();
    return createResponse(alerts);
  }
}